#ifndef MJPEG_CLIENT_H
#define MJPEG_CLIENT_H

#include <QtCore>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QKeyEvent>
#include <QImage>

#include "Camera.h"

class MJPEGClient : public QObject 
{
    Q_OBJECT

public:
    MJPEGClient( QString hostname );
    ~MJPEGClient();

    void resetPanTitl();
    void setLookUp();
    void setLookDown();
    void setLookLeft();
    void setLookRight();

signals:
    void gotNewImage( const QImage* image );

public slots:
    void getVideoFromStreamer();
    void cmdProcessing( QKeyEvent* event);

    void readyRead();
    void finished();

private:
    QNetworkAccessManager* nam;
    QNetworkAccessManager* namCtrl;
    QNetworkReply* reply;

    QString m_hostname;

    QByteArray m_bytes;
};


#endif //MJPEG_CLIENT_H
